package com.study.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Calendar;

@Controller
public class LoginController {

    @GetMapping("/toLoginPage")
    public String toLogin(Model model){

        System.out.println("进入toLoginPage");
        model.addAttribute("currentYear", Calendar.getInstance().get(Calendar.YEAR));

        return "login";
    }

    @GetMapping("/admin")
    public String hello(Model model){

        System.out.println("进入hello");
        model.addAttribute("hello","张三");

        return "hello";
    }

}
